include custom_option.txt
include custom_include.txt
PLUTO_INC =  \
	-I "../../mmi/pme/pmeinc" \
	 -I "../../mmi/mythroad/HcCall/HcCallInc" \
	 -I "../../mmi/mythroad/mythroadinc" \
	 -I "../customerinc"  \
	 -I "../../MMI/PoC/PoCInc"  \
	 -I "../../MMI/DebugLevels/DebugLevelInc"  \
	 -I "../../MMI/Calls/CallsInc"  \
	 -I "../../MMI/ChatApp/ChatAppInc"  \
	 -I "../../MMI/EmailApp/EmailAppInc"  \
	 -I "../../MMI/IPSecApp/IPSecAppInc"  \
	 -I "../../MMI/IMPS/IMPSInc"  \
	 -I "../../MMI/Inc"  \
	 -I "../../MMI/Inc/ImgID"  \
	 -I "../../MMI/Inc/MenuID"  \
	 -I "../../MMI/Inc/StringID"  \
	 -I "../../MtkApp/MtkAppInc"  \
	 -I "../../MtkApp/EngineerMode/EngineerModeApp/EngineerModeAppInc"  \
	 -I "../../MtkApp/EngineerMode/EngineerModeEngine/EngineerModeEngineInc"  \
	 -I "../../MtkApp/FactoryMode/FactoryModeInc"  \
	 -I "../../MtkApp/Connectivity/ConnectivityInc"  \
	 -I "../../MtkApp/SoundRecorder/SoundRecorderInc"  \
	 -I "../../MtkApp/Sndrec/SndrecInc"  \
	 -I "../../MtkApp/AnswerMachine/AnswerMachineInc"  \
	 -I "../../MtkApp/AudioPlayer/AudioPlayerInc"  \
	 -I "../../MtkApp/ABRepeater/ABRepeaterInc"  \
	 -I "../../MtkApp/Connectivity/ConnectivityInc/BtCommon"  \
	 -I "../../MtkApp/mmiapi/include"  \
	 -I "../../MMI/Framework/osl/oslinc"  \
	 -I "../../MMI/CallManagement/CommonFiles/CommonInc"  \
	 -I "../../MMI/CallManagement/OutgoingCallManagement/OutgoingInc"  \
	 -I "../../MMI/CallManagement/IncomingCallManagement/IncomingInc"  \
	 -I "../../MMI/GSMCallApplication/CommonFiles/CommonInc"  \
	 -I "../../MMI/GSMCallApplication/OutgoingCallManagement/OutgoingInc"  \
	 -I "../../MMI/GSMCallApplication/IncomingCallManagement/IncomingInc"  \
	 -I "../../MMI/Setting/SettingInc"  \
	 -I "../../MMI/PhoneBook/PhoneBookInc"  \
	 -I "../../MMI/UDX/UDXInc"  \
	 -I "../../MMI/CommonScreens/CommonScreensInc"  \
	 -I "../../MMI/Framework/CommonFiles/CommonInc"	\
	 -I "../../MMI/Framework/Tasks/TasksInc"  \
	 -I "../../MMI/Framework/EventHandling/EventsInc"  \
	 -I "../../MMI/Framework/History/HistoryInc"  \
	 -I "../../MMI/Framework/MemManager/MemManagerInc"  \
	 -I "../../MMI/DataAccount/DataAccountInc"  \
	 -I "../../MMI/ConnectManagement/ConnectManagementInc"  \
	 -I "../../MMI/FunAndGames/FunAndGamesInc"  \
	 -I "../../MMI/gui/gui_inc"  \
	 -I "../../MMI/gui/oem_inc"  \
	 -I "../../MMI/DateTime/DateTimeInc"  \
	 -I "../../MMI/MiscFramework/MiscFrameworkInc"  \
	 -I "../../MMI/Help/HelpInc"  \
	 -I "../../MMI/IdleScreen/IdleScreenInc"  \
	 -I "../../MMI/Messages/MessagesInc"  \
	 -I "../../MMI/NITZHandler/NITZInc"  \
	 -I "../../MMI/PROFILES/ProfilesInc"  \
	 -I "../../MMI/SAT/SATInc"  \
	 -I "../../MMI/SSC/SSCInc"  \
	 -I "../../MMI/Organizer/OrganizerInc"  \
	 -I "../../MMI/Organizer\IndianCalendar\IndianCalendarInc"  \
	 -I "../../MMI/Organizer\HijriCalendar\HijriCalendarInc"  \
	 -I "../../MMI/Extra/ExtraInc"  \
	 -I "../../MMI/JataayuApp\jBrowserMMI\jBrowserMMIInc"  \
	 -I "../../MMI/UnifiedMMS/MMSApp/MMSAppInc"  \
	 -I "../../MMI/JataayuApp\jCommonModules\jProvisioning\jProvisioningInc"  \
	 -I "../../MMI/JataayuApp\jCommonModules\jProfileHandler\jProfileHandlerInc"  \
	 -I "../../MMI/JataayuApp\jMMSMMI\jMMSMMIInc"  \
	 -I "../../MMI/Customer/CustResource"  \
	 -I "../../MMI/FontData"  \
	 -I "../../MMI/debuglevels/DebugLevelInc"  \
	 -I "../../MMI/MainMenu/MainMenuInc"  \
	 -I "../../MMI/ems/emsinc"  \
	 -I "../../MMI/Dictionary/DictInc"  \
	 -I "../../MMI/Framework/NVRAMManager/NVRAMManagerInc"  \
	 -I "../../MMI/EbookReader/EbookInc"  \
	 -I "../../MMI/VoIP/VoIPInc"  \
	 -I "../../MMI/UCM/UCMInc"  \
	 -I "../../MMI/Ctm/CtmInc"  \
	 -I "../../Service/Gsm3gCallSrv"  \
	 -I "../../Service/UcmSrv"  \
	 -I "../../../kal/include"  \
	 -I "../../../ps/interfaces/enum"  \
	 -I "../../../ps/l4/include"  \
	 -I "../../../ps/gen/mcd"  \
	 -I "../../../ps/interfaces/local_inc"  \
	 -I "../../MMI/CPHS/CPHSInc"  \
	 -I "../../MMI/audio/audioinc"  \
	 -I "."  \
	 -I "../../../custom/audio/MT6208_CEVB"  \
	 -I "../Customize"  \
	 -I "../.."  \
	 -I "../../../custom/audio/CHICAGO2003_BB"  \
	 -I "../../../custom/audio/KLM2003_BB"  \
	 -I "../../../interface/mmi"  \
	 -I "../../MTkApp/Camera/CameraInc"	\
	 -I "../../MTkApp/Video/VideoInc"	\
	 -I "../../MTkApp/FileMgr/FileMgrInc" \
	 -I "../../../j2me/interface" \
	 -I "../../../j2me/jam/include" \
	 -I "../../MTkApp/GDI/GDIInc" \
	 -I "../../../fmt\include" \
	 -I "../../MTkApp/vObjects/vObjectInc" \
	 -I "../../MMI/Stopwatch/StopwatchInc"  \
	 -I "../../MTkApp/FMRadio/FMRadioInc"  \
	 -I "../../MTkApp/MediaPlayer/MediaPlayerInc"  \
	 -I "../../MTkApp/FMScheduleRec/FMScheduleRecInc"  \
	 -I "../../MTkApp/VRSD/VRSDInc" \
	 -I "../../MTkApp/VRSI/VRSIInc" \
	 -I "../../MTkApp/PhotoEditor\PhotoEditorInc" \
	 -I "../../MTkApp/BGSound/BGSoundInc" \
	 -I "../../MMI/Resource\Inc" \
 	 -I "../../../vendor/wap/jataayu4/adaptation/mmi/srcs/include" \
	 -I "../../MtkApp\JavaAgency\JavaAgencyInc" \
	 -I "../../MMI/UnifiedMessage/UnifiedMessageInc" \
	 -I "../../MTkApp/BarcodeReader/BarcodeReaderInc" \
	 -I "../../MTkApp/SWFlash/SWFlashInc" \
	 -I "../../MTkApp/SyncML/SyncMLInc" \
	 -I "../../MMI/UnifiedComposer/UnifiedComposerInc" \
	 -I "../../MtkApp/VideoEditor/VideoEditorInc" \
	 -I "../../MTkApp/DeviceManagement/DeviceManagementInc" \
	 -I "../../MtkApp/CentralConfigAgent/CentralConfigAgentInc" \
	 -I "../../MTkApp/Avatar/AvatarInc" \
	 -I "../../MtkApp/CSBrowser/CSBrowserInc" \
	 -I "../../MtkApp/PictBridge/PictBridgeInc" \
	 -I "../../MMI/BrowserApp/Browser/BrowserInc" \
	 -I "../../MMI/BrowserApp/Profile/ProfileInc" \
	 -I "../../MMI/BrowserApp/PushInbox/PushInboxInc"  \
	 -I "../../MTkApp/RightsMgr/RightsMgrInc" \
	 -I "../../MtkApp/DMUIApp/DMUIAppInc" \
	 -I "../../MMI/MobileService/MobileServiceInc" \
	 -I "../../MMI/CustomerService/CustomerServiceInc" \
	 -I "../../../vendor/langlearn/app/inc" \
	 -I "../../../vendor/mercury_master/inc" \
	 -I "../../MTkApp/MyFavorite/MyFavoriteInc" \
	 -I "../../MtkApp/MobileTVPlayer/MobileTVPlayerInc" \
	 -I "../../MMI/VideoCall/VideoCallInc" \
	 -I "../../MMI/UnifiedMMS/MMSBGSR/MMSBGSRInc"  \
	 -I "../../../vendor/gis/mapbar/mmi/inc"  \
	 -I "../../mercury_master/inc" \
         -I "../../MtkApp/SoftwareTracer/SoftwareTracerInc" \
	 -I "../../../vendor/gis/sunavi/mmi/inc"    \
	 -I "../../../vendor/gis/migo/mmi/inc"    \
	 -I "../../../vendor/mercury_master/inc"    \
	 -I "../../../vendor/qqim/adaptation/inc"    \
	 -I "../../MTkApp/Camcorder/CamcorderInc"    \
         -I "../../MTkApp/DCD/DCDInc"    \
         -I "../../MTkApp/BCR/BCRInc"    \
         -I "../../MtkApp/GPS/GPSInc" \
         -I "../../MtkApp/MMSPostcard/MMSPostcardInc"     \
         -I "../../MtkApp/MDI/MDIInc"     \
	 -I "../../../vendor/ucweb/adaptation/include"	\
	 -I "../../../vendor\streaming\a8box\adaptation\inc" \
	 -I "../../../vendor/streaming/gglive/app/ggliveinc" \
	 -I "../../MMI/ProvisioningInbox/ProvBoxUI/ProvBoxUIInc" \
	 -I "../../../vendor\vre30\include" \
	 -I "../../../vendor\vre\include" \
	 -I "../../../venusmmi/pluto_adapter/interface/res" \
	 -I "../../../venusmmi/framework/ui_core/base" \
	 -I "../../../vendor/streaming/qqmovie/mmi"  \
	 -I "../../MMI/WapAgent/WapAgentInc" \
     	 -I "../../Customer/ResGenerator/zlib" \
     	 -I "./ResgenXML/ResgenInc" \
     	 -I "./ResgenXML/CustResInc" \
	 -I "../../MTkApp/VREAPP/VREAPPInc" \
         -I "../../Service/PlstSrv"  \
         -I "../../MMI/CubeApp/CubeAppInc" \
	 -I "../../../vendor/opera/browser/adaptation/inc" \
         -I "../../MMI/Idle/IdleInc" \
         -I "../../MMI/Dialer/DialerInc" \
         -I "../../MMI/ScrLocker/ScrLockerInc" \
         -I "../../MMI/ScrSaver/ScrSaverInc"

INC = $(PLUTO_INC) ${CUSTOM_INC}

MTK_DEFS = \
	-D "__MULTI_BIN_LOAD__" \
	-D "__EXE_DLL__"

SHARE_DEFS = \
	-D "WIN32"\
	-D "_DEBUG"\
	-D "_WINDOWS"\
	-D "_MBCS"\
	-D "_CONSOLE"\
	-D "__UCS2_ENCODING"\
	-D "MMI_ON_WIN32"\
	-D "__RESOURCE_GEN_"\
	-D "_L4_COMMON_STRUCT_H"\
	-D "DEVELOPER_BUILD_FIRST_PASS"\
	-D "_AFXDLL"\
	-D "__MOD_SMSAL__"\
	-D "__SAT__"\
	-D "SHORTCUTS_APP"\
	-D "__POPULATE_ENGINE_"\
	-D "DEBUG_WINDOW"\
	-D "VM_SUPPORT" \
	-D "_WINERROR_H" \
	-D "_LIB"\
	-D "NO_GZIP"\
	-D "NO_ERRNO_H"\
	-D "NOBYFOUR"\
        -D "__XML_SUPPORT__" \
	${CUSTOM_OPTION}

DEFINE = $(MTK_DEFS) $(SHARE_DEFS)

MMI_FEATURES_H = ../../MMI/Inc/MMI_features.h
ENUM_LIST_H = ./enum_list.h

OUTDIR =./debug/obj
OUTDIR_XML =./debug/res

OBJECTS = $(PLUTOMMI_OBJS) $(RES_OBJS) $(MTK_OBJS) $(ZLIB_OBJS)

PLUTOMMI_OBJS = \
	$(OUTDIR)/CustResDeclare.o\
	$(OUTDIR)/PopulateRes.o\
	$(OUTDIR)/WriteRes.o\
	$(OUTDIR)/ResBytestream.o\
	$(OUTDIR)/BMPLoader.o\
	$(OUTDIR)/ABMLoader.o\
	$(OUTDIR)/bmp2ems.o\
	$(OUTDIR)/GIFLoader.o\
	$(OUTDIR)/ImageGetDimension.o\
        $(OUTDIR)/CmidiGen.o

MTK_OBJS = \
    $(OUTDIR)/mtk_resgenerator.o\
    $(OUTDIR)/str_merge.o\
    $(OUTDIR)/FontRes.o

RES_SOURCES = $(patsubst ../Res_MMI/%, %,$(wildcard ../Res_MMI/*.c))
ZLIB_SOURCES = $(patsubst ./zlib/%, %,$(wildcard ./zlib/*.c))

RES_OBJS = $(patsubst %.c,$(OUTDIR)/%.o,$(RES_SOURCES))
ZLIB_OBJS = $(patsubst %.c,$(OUTDIR)/%.o,$(ZLIB_SOURCES))

RES_XML_SOURCES = $(patsubst ./temp/res/%, %,$(wildcard ./temp/res/*.c))
RES_XML_I = $(patsubst %.c,$(OUTDIR_XML)/%.i,$(RES_XML_SOURCES))

REF_LIST_MERGE_OBJS = $(OUTDIR)/ref_list_merge.o

PLMNCREATE_OBJS = $(OUTDIR)/plmncreate.o

RES_XML_RES = $(patsubst ./ResgenXML/ResgenSrc/%, %,$(wildcard ./ResgenXML/ResgenSrc/*.c))
RES_XML_OBJS = $(patsubst %.c,$(OUTDIR)/%.o,$(RES_XML_RES))

RES_XML_CUST_RES = $(patsubst ./ResgenXML/CustResSrc/%, %,$(wildcard ./ResgenXML/CustResSrc/*.c))
RES_XML_CUST_OBJS = $(patsubst %.c,$(OUTDIR)/%.o,$(RES_XML_CUST_RES))

RES_XML_OBJS_ALL = $(RES_XML_OBJS) $(RES_XML_CUST_OBJS)


INC_PATH_LIST = $(patsubst "%",%,$(filter "%",$(PLUTO_INC)))

H_LIST = $(filter-out %enum_list.h,$(foreach list, $(INC_PATH_LIST), $(wildcard $(list)/*.h)))

	
.SUFFIXES: .o .cpp .c

$(OUTDIR)/ref_list_merge.o: ref_list_merge.c $(H_LIST)
	@echo Compiling $< & 
	@gcc $(DEFINE) $(INC) -g -w -c $< -o $@

$(OUTDIR)/plmncreate.o: plmncreate.c $(H_LIST)
	@echo Compiling $< & 
	@gcc $(DEFINE) $(INC) -g -w -c $< -o $@

xml_files: $(RES_XML_I) $(H_LIST)
$(RES_XML_I):$(OUTDIR_XML)/%.i: temp/res/%.c
	@echo Compiling $< & 
	@gcc $(DEFINE) $(INC) $< -E > $@

$(OUTDIR)/%.o: %.c $(H_LIST)
	@echo Compiling $< & 
	@gcc $(DEFINE) $(INC) -g -c -w $< -o $@

$(OUTDIR)/%.o: %.cpp $(H_LIST)
	@echo Compiling $< & 
	@g++ $(DEFINE) $(INC) -g -c -w $< -o $@


VPATH=../Res_MMI:.:../CustResource:../../MMI/Resource:../../MMI/MiscFramework/MiscFrameworkSrc:./ResgenXML/ResgenSrc:./ResgenXML/CustResSrc:./zlib/

resgen_xml.exe: $(RES_XML_OBJS_ALL)
	@echo Linking *.o for resgen_xml.exe...
	@gcc -g -o resgen_xml  $(RES_XML_OBJS_ALL) 

mtk_resgenerator.exe: $(OBJECTS)
	@echo Linking *.o for mtk_resgenerator.exe...
	@gcc -g -o mtk_resgenerator  $(OBJECTS) 

ref_list_merge.exe: $(REF_LIST_MERGE_OBJS)
	@echo Linking $< & 
	@gcc -g -o ref_list_merge  $(REF_LIST_MERGE_OBJS)

plmncreate.exe: $(PLMNCREATE_OBJS)
	@echo Linking $< & 
	@gcc -g -o plmncreate  $(PLMNCREATE_OBJS)


